package org.example.novelcrawler.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.Map;

@Data
public class CrawlConfig {
    private String startUrl;
    private int chapterInterval;
    private String nextPageSelector;
    private String titleSelector;
    private String contentSelector;
    private String nextLoop;
    private String nextLoopTitle;
    private Map<String,String> headers;
    private String methodType;


    public CrawlConfig() {
        this.methodType = "GET";
    }

    public CrawlConfig(@JsonProperty("startUrl")String startUrl,
                       @JsonProperty("chapterInterval")int chapterInterval,
                       @JsonProperty("nextPageSelector")String nextPageSelector,
                       @JsonProperty("titleSelector")String titleSelector,
                       @JsonProperty("contentSelector")String contentSelector,
                       @JsonProperty("nextLoop")String nextLoop,
                       @JsonProperty("nextLoopTitle")String nextLoopTitle,
                       @JsonProperty("headers")Map<String,String> headers,
                       @JsonProperty("methodType")String methodType) {
        this.startUrl = startUrl;
        this.chapterInterval = chapterInterval;
        this.nextPageSelector = nextPageSelector;
        this.titleSelector = titleSelector;
        this.contentSelector = contentSelector;
        this.nextLoop = nextLoop;
        this.nextLoopTitle = nextLoopTitle;
        this.headers = headers;
        this.methodType = methodType;
    }

}